package com.gzs.space.entity;

import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author GZS
 * @date 2022年04月23日
 */
@Data
public class User extends BaseEntity{

	@NotNull(message = "用户名不能为空")
	@Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9_]{4,15}$",message = "字母开头，允许5-16字节，允许字母数字下划线")
	private String userName;

	@NotNull(message = "用户名不能为空")
	@Pattern(regexp = "^.{4,20}$",message = "请输入4位及以上密码")
	private String passWord;

	@NotNull(message = "用户名不能为空")
	@Pattern(regexp = "^.{4,20}$",message = "请输入4位及以上密码")
	private String rePassWord;

	@Pattern(regexp = "^1(3[0-9]|5[0-3,5-9]|6[1-3,6-9]|7[1-3,5-8]|8[0-9])\\d{8}$",message = "非法手机号")
	private String phone;

	@Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$",message = "非法邮箱")
	private String email;
}
